/**
 * Author: Li
 * Date: 10/30/2025 20:55
 * Description: index
 */
import { createRouter, createWebHashHistory } from "vue-router"

const routes = [
  {
    path: "/login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: "登录",
    },
  },
  // 定义404页面
  {
    path: "/:pathMatch(.*)*",
    component: () => import("@/views/error/404.vue"),
    meta: {
      title: "404",
    },
  },
]
const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

// 路由导航首位
router.beforeEach((to, from) => {
  return true
})

export function setup(app) {
  app.use(router)
}
